
<script src="web/assets/plugins/jquery-validation/js/jquery.validate.min.js" type="text/javascript"></script>
<script src="./fuentes/view/pokerEstructura/js/script_ajax_poker_estructura_detalle.js" type="text/javascript"></script>
<script src="web/assets/js/validadores_numericos.js" type="text/javascript"></script> 
<div class="clearfix"></div>
<div class="content">  
    <input type="hidden" name="estructuraID"  id="estructuraID" class="form-control" value="<?php if (!empty($estructura_id)) echo $estructura_id; ?>">
    <span  style="float: right;"><h3><?php if (!empty($pokerEstructuras)) echo $pokerEstructuras[0]['nombre']; ?></h3></span>
    <div class="page-title" style="width: 300px"> 
        <a href="javascript:void(0)" onclick="volver();" rel="ajax" class="active"><i class="icon-custom-left"></i><h3>Lista de Estructuras</h3></a>
    </div> 

    <!-- Modal -->
    <div class="modal fade" id="myModalPokerEstructuraADD" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                    <br>
                    <i class="icon-credit-card icon-7x"></i>
                    <h4 id="myModalLabel" class="semi-bold">Estructura</h4>
                    <p class="no-margin"> </p>
                    <br>
                </div>

                <div class="modal-body">
                    <form  action="./fuentes/controller/PokerEstructuraDetalle.php" id="formPokerEstructura" name="formPokerEstructura" autocomplete="off" > 
                       
                        <?php require_once '/FormPokerEstructuraDetalle.php'; ?>

                    </form>    
                </div>
                <!-- /.modal-content -->
            </div>
            <!-- /.modal-dialog -->
        </div>
        <!-- /.modal -->
    </div>

    <div class="row" id="movimiento">
        <div class="col-md-12">
            <div class="grid simple ">
                <div class="grid-title no-border">
                    <h4><span class="semi-bold">Estructura del Torneo</span></h4>
                    <button style="float: right;" class="btn btn-success btn-xs " onclick="setEstructuraForm();" id="agregar" data-toggle="modal"  data-target="#myModalPokerEstructuraADD"> Agregar</button>
                    <div class="labelRight" id="error">	

                    </div>
                </div>
                <div class="grid-body no-border">

                    <table class="table table-hover no-more-tables table-condensed  " id="pokerEstructuraTABLE">
                        <thead>
                            <tr>
                                <th class='text-center' style="width:10%" >Nivel</th>
                                <th class='text-right' style="width:10%" >Ante</th>
                                <th class='text-right' style="width:10%">Small Blind </th>
                                <th class='text-right' style="width:10%">Big Blind </th>
                                <th class='text-right' style="width:10%">Duración </th>
                                <th class='text-right' style="width:10%">Break </th>
                                <th class='text-center' style="width:7%">Acciones</th>
                            </tr>
                        </thead>
                        <tbody id="pokerEstructuraList">

                            <?php
                            $niv=0;
                            if ($pokerEstructuras) {
                                foreach ($pokerEstructuras as $dato) {
                                    $niv++;
                                    echo "<tr>
                                        <td class='text-center'>" . $dato["nivel"] . "</td>
                                        <td class='text-right'>" . $dato["ante"] . "</td>
                                        <td class='text-right'>" . $dato["small_blind"] . "</td>
                                        <td class='text-right'>" . $dato["big_blind"] . "</td>
                                        <td class='text-right'>" . $dato["duracion"] . " min.</td>    
                                        <td class='text-right'>" . $dato["break"] . " min.</td>
                                        <td class='text-center'>
                                            <button class='btn btn-success btn-xs btn-mini' onclick='editDatos(" . $dato["id"] . ")' title='Editar' ><i class='fa fa-pencil'></i></button>&nbsp;&nbsp;
                                            <button class='btn btn-success btn-xs btn-mini' onclick='eliminarDato(" . $dato["id"] . ")' title='Eliminar' ><i class='fa fa-times'></i></button>
                                        </td>
                                     </tr>";
                                }
                            } else {
                                echo "<tr><td colspan='7' class='text-center'><h4> No existen Registros </h4></td></tr>";
                            }
                            ?>
                        </tbody>
                    </table>
                    <input type="hidden" name="nivUltimo"  id="nivUltimo"  value="<?php echo $niv; ?>">
                </div>
            </div>
        </div>
    </div>
</div>




